std::pin::Pin を理解する
If the pointee value’s type implements Unpin, we are free to disregard these requirements entirely and can wrap any pointer to that value in Pin directly via Pin::new.
These compiler-generated Futures may contain self-referential pointers, one of the most common use cases for Pin. More details on this point are provided in the pin module docs, but suffice it to say they require the guarantees provided by pinning to be implemented soundly.
Pin<T> は 自己参照データ構造 を安全に扱うために導入 されたが、その内部データへのアクセスには制限がかかるため、直接変更しようとすると unsafe を使う必要がある It is important to stress that the thing in the Pin is not the value which we want to pin itself, but rather a pointer to that value! A Pin<Ptr> does not pin the Ptr but rather the pointer’s pointee value.
Pin<T> は ポインタの指すデータを固定するが、ポインタ自体が無理やりムーブされる可能性がある
ヒープ上のデータはポインタを通じて管理されるため、基本的にはムーブされにくい